home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
- *
- * Apple Macintosh Developer Technical Support
- *
- * Installer 3.2 sample: Action Atoms
- *
- * File: SetLockBit.c - c Source
- *
- * by: Rich Kubota
- *
- * Copyright © 1990-1992 Apple Computer, Inc.
- * All rights reserved.
- *
- * Purpose: Sample to demonstrate setting the file lock bit. This action
- * atom code resource must be called through a post installation action
- * atom. In the selector field, pass in the name of the target 'infs'
- * resource id. The code resource gets the resource, converts the partial
- * path name field to a pascal string, then calls, SetFLock. A result of
- * true is always returned so as not to abort the installation.
- *
- * This action atom is designed for use by both Installer 3.2 and 3.3
- *----------------------------------------------------------------------------*/
-
- #if 0
-
- C -r -b SetLockBit.c
- Link -ra =resPurgeable -t rsrc -c RSED -rt infn=10000 ∂
- -m SETLOCKBIT -sg SetLockBit ∂
- SetLockBit.c.o ∂
- "{Libraries}"Interface.o ∂
- -o SetLockBit.rsrc
-
- #endif
-
- #include <Types.h>
- #include <Resources.h>
- #include <Files.h>
- #include "ActionAtomIntf.h"
-
- /* define record structure of 'infs' resource so that we can access the target file path */
-
- struct infsRec {
- long fileType;
- long creator;
- long creationDate;
- short fileSpecFlags;
- Str255 pathName;
- };
-
- typedef struct infsRec infsRec;
- typedef infsRec **infsHdl;
-
- /* protoypes */
- void makePStr(char *fm, char *to);
-
-
- pascal Boolean SETLOCKBIT(AAPBRecPtr myAAPBPtr)
- {
- OSErr err;
- infsHdl resH;
-
- resH = (infsHdl)GetResource('infs', myAAPBPtr->aaRefCon);
- if (resH)
- err = SetFLock((*resH)->pathName, myAAPBPtr->targetVRefNum);
- return true;
- }
-